﻿@model ByHand.Model.Provider

<div class="alert alert-success">
    <p id="p-mess"></p>
</div>
<table class="table">
    <caption>Provider</caption>
    <tr>
        <td>
            @Html.DisplayNameFor(model => model.Name)
        </td>
        <td>
            @Html.DisplayFor(model => model.Name)
        </td>
    </tr>
    <tr>
        <td>
            @Html.DisplayNameFor(model => model.ProviderCode)
        </td>
        <td>
            @Html.DisplayFor(model => model.ProviderCode)
        </td>
    </tr>
    <tr>
        <td>
            @Html.DisplayNameFor(model => model.CreatedDate)
        </td>
        <td>
            @Html.DisplayFor(model => model.CreatedDate)
        </td>
    </tr>
    <tr>
        <td>
            @Html.DisplayNameFor(model => model.ModifiedDate)
        </td>
        <td>
            @Html.DisplayFor(model => model.ModifiedDate)
        </td>
    </tr>
    <tr>
        <td>
            @Html.DisplayNameFor(model => model.BgColor)
        </td>
        <td>
            @Html.DisplayFor(model => model.BgColor)
        </td>
    </tr>
    <tr>
        <td>
            @Html.DisplayNameFor(model => model.LinkColor)
        </td>
        <td>
            @Html.DisplayFor(model => model.LinkColor)
        </td>
    </tr>
    <tr>
        <td>
            @Html.DisplayNameFor(model => model.ProviderLink)
        </td>
        <td>
            @Html.DisplayFor(model => model.ProviderLink)
        </td>
    </tr>
    <tr>
        <td>
            @Html.DisplayNameFor(model => model.Description)
        </td>
        <td>
            @Html.DisplayFor(model => model.Description)
        </td>
    </tr>
</table>
<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.ID }) |
    @Html.ActionLink("Back to List", "Index")
</p>
<button type="button" class="btn btn-primary" onclick="importProducts(@Model.MerchantID)">Import</button>
<script>
    function importProducts(mid) {
        $.post('@Url.Action("Import", "Provider")', { merchantID: mid }, function (data) {
            $('#p-mess').text(data+' sản phẩm được thêm thành công!');
        });
    }
</script>
